import request from '/@/utils/request';
import { paramsSerializer } from '/@/utils/sort';

// 壁纸列表
export const paperList = (params?: object) => {
  return request({
    url: 'api/v1/admins/paper',
    method: 'get',
    params,
    paramsSerializer
  })
}

// 壁纸详情
export const paperDetail = (id: number) => {
  return request({
    url: `api/v1/admins/paper/${id}`,
    method: 'get',
  })
}

// 新增壁纸
export const addPaper = (data: Object) => {
  return request({
    url: `api/v1/admins/paper`,
    method: 'post',
    data
  })
}

// 修改壁纸
export const updatePaper = (data: Object) => {
  return request({
    url: `api/v1/admins/paper`,
    method: 'put',
    data
  })
}

// 删除壁纸
export const deletePaper = (id: number) => {
  return request({
    url: `api/v1/admins/paper/${id}`,
    method: 'delete'
  })
}
